<?php
//表单请求类  
namespace App\Http\Requests;

use App\Http\Requests\Request;

class UserPostPostRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    //是否开启表单验证请求  
    public function authorize()
    {
        return true;//return true为开启表单验证
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     *//
    public function rules()
    {
        return [
        'username' => 'required|max:255',
        'password' => 'required|regex:/\w{6,10}/',
        'repassword' => 'required',
        ];
    }
    public function messages(){
        return[
        'username.required'=>'用户名必须填写',
        'username.max'=>'用户名的长度是255',
        'password.required'=>'密码必须填写',
        'repassword.required'=>'确认密码必须填写',
        'password.regex'=>'密码长度为6到10位',

        ];
    }
}
